<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
    <script src="../../../scripts/jquery.min.js"></script>
    <script src="../../../scripts/miniui/miniui.js"></script>
    <link href="../../../scripts/miniui/themes/default/miniui.css" rel="stylesheet">
    <link href="../../../scripts/miniui/themes/icons.css" rel="stylesheet">
    <link href="../../../scripts/miniui/themes/pure/skin.css" rel="stylesheet">
    <script src="../../../scripts/core.js"></script>

</head>
<body>


<div id="form1">
    <table>
        <tr>
            <td><label for="pwd$text">任务名称：</label></td>
            <td>
                <input class="mini-textbox" maxValue="100" minValue="1" name="name" style="width:350px;"></input>
            </td>
        </tr>
        <tr>
            <td><label for="pwd$text">分享链接：</label></td>
            <td>


                <input class="mini-textbox" maxValue="100" minValue="1" name="url" style="width:350px;"
                ></input>

            </td>
        </tr>
        <tr>
            <td><label for="pwd$text">体力奖励：</label></td>
            <td>


                <input class="mini-spinner" maxValue="100" minValue="1" name="energy" style="width:350px;"
                ></input>

            </td>
        </tr>
        <tr>
            <td><label for="pwd$text">赛道id：</label></td>
            <td>
                <input class="mini-spinner" maxValue="100000000" minValue="1" name="raceId" style="width:350px;"
                ></input>

            </td>
        </tr>
        <tr>
            <td><label for="pwd$text">代币数量：</label></td>
            <td>
                <input class="mini-spinner" maxValue="10000" minValue="1" name="raceVal" style="width:350px;"
                ></input>

            </td>
        </tr>
        <tr>
            <td><label for="pwd$text">排序字段：</label></td>
            <td>
                <input class="mini-spinner" maxValue="100000000" minValue="1" name="orderIndex" style="width:350px;"
                ></input>

            </td>
        </tr>
        <tr>
            <td><label for="pwd$text">校验处理器：</label></td>
            <td>
                <input class="mini-spinner" maxValue="10000" minValue="0" name="verifyType" style="width:350px;"
                ></input>

            </td>
        </tr>
        <tr>
            <td></td>
            <td>
                <input onclick="submitForm()" type="button" value="提交"/>
            </td>
        </tr>
    </table>
</div>


<script type="text/javascript">
    var auth = GetParams()
    console.log(auth)
    mini.parse();

    function submitForm() {

        var form = new mini.Form("#form1");
        //提交数据
        var data = form.getData();
        data.typeId = auth.typeId;
        var json = mini.encode(data);
        $.ajax({
            url: "/cmsapi/addTaskCfg",
            headers: {"userId": auth.userId, "token": auth.token},
            data: json,
            type: "post",
            contentType: 'application/json',
            success: function (text) {
                if (window.CloseOwnerWindow) return window.CloseOwnerWindow("ok");
                else window.close();
            }
        });
    }

</script>


</body>
</html>